Skip to content

Table scheme import - #2888

Draft
luka-nextcloud wants to merge 10 commits into
mainfrom
table-scheme-import
Draft

Table scheme import#2888
luka-nextcloud wants to merge 10 commits into
mainfrom
table-scheme-import

Conversation

@luka-nextcloud

Copy link
Copy Markdown
Contributor

🖼️ Screenshots

🏚️ Before 🏡 After
B A

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@blizzz blizzz linked an issue Aug 14, 2026 that may be closed by this pull request
8 tasks
luka-nextcloud and others added 6 commits August 17, 2026 09:15
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Luka Trovic <luka@nextcloud.com>
Signed-off-by: Luka Trovic <luka@nextcloud.com>

@blizzz blizzz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Early comments, some can be left for later.

UI wise it looks really nice already!

Image
  • I would not display the UUID as title in the check box. It looks technical and table managers will have not deeper knowledge about it. Would completely keeps this identifier internal and instead use the New Title.

  • In my quick test I also see that Views would be dropped instead of being kept

  • Maybe need to double check the sort order as well when nothing is defined

This is very promising already! :)

Comment thread lib/Migration/Version2200Date20260819000000.php
Comment thread lib/Controller/ContextController.php Outdated
Comment thread lib/Controller/ContextController.php Outdated
*/
#[NoAdminRequired]
#[RequirePermission(Application::PERMISSION_MANAGE, null, 'context', 'contextId')]
public function importScheme(int $contextId, ?string $name, ?string $iconName, ?string $description, ?array $nodes, ?array $tables): DataResponse {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node sure I understand correctly the role of $nodes vs $tables. Maybe have an idea with the TODO against the nodes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$nodes is array ids of tables and views to be shown. The $tables is array of related source tables.

Comment thread lib/Service/ColumnService.php Outdated
use OCA\Tables\Errors\NotFoundError;
use OCA\Tables\Errors\PermissionError;

class StructureService {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it comes from me, just to note down one thought that circles my mind is whether to add Stateful to the class name for safer usage 🤔 Again, nothing that cannot be improved upon later on.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it can be improved later.

Comment thread lib/Service/TableService.php Outdated
$columns = $this->columnService->findAllByTable($id, null, $table);
$this->enhanceTable($table, $userId);
return new TableScheme($table->getTitle(), $table->getEmoji(), $columns, $table->getViews() ?: [], $table->getDescription() ?: '', $this->appManager->getAppVersion('tables'), $table->getColumnOrderSettingsArray(), $table->getSortArray());
$this->enhanceTable($table, $userId ?? $this->userId);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suppose there is a reason for this line change? ^

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would cause error when $userId is null

Comment thread lib/Service/ViewService.php Outdated
Signed-off-by: Luka Trovic <luka@nextcloud.com>
@luka-nextcloud

Copy link
Copy Markdown
Contributor Author

@blizzz

In my quick test I also see that Views would be dropped instead of being kept

Does it mean that we should remove the Remove Views section?
image

Maybe need to double check the sort order as well when nothing is defined

Could you please share more details?

@blizzz

blizzz commented Aug 20, 2026

Copy link
Copy Markdown
Member

@blizzz

In my quick test I also see that Views would be dropped instead of being kept

Does it mean that we should remove the Remove Views section?

No, that should be there!

In my test, the scheme file I uploaded did not have any changes with the views. However the dialog showed they would be removed, instead of kept.

Signed-off-by: Luka Trovic <luka@nextcloud.com>
@luka-nextcloud

Copy link
Copy Markdown
Contributor Author

@blizzz

In my quick test I also see that Views would be dropped instead of being kept

Does it mean that we should remove the Remove Views section?

No, that should be there!

In my test, the scheme file I uploaded did not have any changes with the views. However the dialog showed they would be removed, instead of kept.

The application scheme includes the table schemes of related source tables. So it also detects the different views of those tables. Should we skip processing removed views when importing application scheme?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Structure update

2 participants